//
//  DetailStarCell.m
//  QoilPublic
//
//  Created by SunChao on 17/9/9.
//  Copyright © 2017年 杨凯. All rights reserved.
//

#import "DetailStarCell.h"


@implementation DetailStarCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
   
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)SetupStarViewWith:(NSString *)str indexPathOfRow:(NSUInteger)row canEdit:(BOOL)canEdit starNum:(NSString *)starNum evaluate:(NSString *)evaluate{
    if (_starView == nil) {
        
        _starView = [[StarView alloc]initWithFrame:CGRectMake(0, 10, kScreenWidth, 30) leftTitle:str EmptyImage:@"statgray_image" StarImage:@"statyellow_image" canEdit:canEdit starNum:starNum Evaluate:evaluate];
        [self addSubview:_starView ];
    }
    __weak DetailStarCell *wSelf = self;
    _starView.block = ^(NSString *str){
       
        NSLog(@"label:%@",str);
        
        if(wSelf.delegate && [wSelf.delegate respondsToSelector:@selector(gainStarWithText:indexPathOfRow:)]){
            
            [wSelf.delegate gainStarWithText:str indexPathOfRow:row];
        }
    };
    
}
@end
